blob: b9decb301ceee765591a252c44b3e2c0e32cec1d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
import NextAuth from "next-auth"
import { PrismaAdapter } from "@next-auth/prisma-adapter"
import AuthentikProvider from "next-auth/providers/authentik";
import { PrismaClient } from "@prisma/client"
import serverConfig from "@/lib/config";
const prisma = new PrismaClient()
let providers = [];
if (serverConfig.auth.authentik) {
providers.push(AuthentikProvider(serverConfig.auth.authentik));
}
const handler = NextAuth({
// Configure one or more authentication providers
adapter: PrismaAdapter(prisma),
providers: providers,
});
export { handler as GET, handler as POST }
|